<template>
    <div class="zhuanye">
        <el-container>
      
              <utabbar :tabactiv="3"></utabbar>
            </el-container>
            <el-main>
                <div class="maintop">
                    <el-form :model="form" class="demo-form-inline">
                        门类<el-input v-model="form.Category"></el-input>
                        专业类<el-input v-model="form.Professional"></el-input>
                        专业名称<el-input v-model="form.professionaltitle"></el-input>
                        <el-form-item>
                            <el-button type="primary" @click.prevent="onSubmit">查询</el-button>
                        </el-form-item>
                    </el-form>
                </div>
                <div class="mainbottom">
                    <div class="queryschool">
                        <el-table  v-loading="loading"
                         :data="tableData" border="false" style="width: 100%" :row-style="changeCss">
                            <el-table-column prop="professionalCode" label="专业代号" width="128">
                            </el-table-column>
                            <el-table-column prop="professionaltitle" label="专业名称" width="278" >
                            </el-table-column>
                            <el-table-column prop="category" label="门类" width="138">
                            </el-table-column>
                            <el-table-column prop="professional" label="专业类型" width="278">
                            </el-table-column>
                            <el-table-column prop="years" label="学制" width="125">
                            </el-table-column>
                            <el-table-column fixed="right" label="操作" width="80">
                    <template slot-scope="scope">
                        <el-button @click="getspinfo(scope.row.professionaltitle)" type="primary" size="">查看</el-button>
                        <!-- <el-button type="danger" icon="el-icon-delete" @click="delVolunteer(scope.row.id)"></el-button> -->
                    </template>
                </el-table-column>
                        </el-table>
                    </div>
                   
                </div>
                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="currentPage4" :page-sizes="pageSizes" :page-size="100"
              layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination>
            </el-main>
            <el-footer></el-footer>
       
    </div>
</template>
<script>
import axios from 'axios';
import Vue from "vue";
import Fcee_url from "../js/fceeConfig";
import tabbar from "./fceecomponents/my-tabbar.vue"
import utabbar from "./fceecomponents/uitabbar.vue"
import erro from "./erro.vue"
import tool from './tool/tool';
Vue.prototype.$Fcee_url = Fcee_url
export default {
    components:{
        tabbar,
        utabbar,
    },
    data() {
        return {
            form: {
                Category: '',
                Professional: '',
                professionaltitle:''
            },
            UserInfo_url: '',
            UserName: '',
            total: 1,
            pageNum: 1,
            pageSizes: [10, 20],
            tableData: '',
            loading:false
        }
    },
    methods: {
        handleCurrentChange(val) {//翻页
            // console.log(`当前页: ${val}`);
            //
            this.pageNum = val;
            this.start1()


        },
        getspinfo:function(professionaltitle){
            this.$router.push(   
                {path:'/spinfo',
                name:'spinfo',
                params:{
                
                spname:professionaltitle
                }})
        },
        changeCss({row,rowIndex}){
            if(rowIndex==1){
                return 'font-size:30'
            }
        },
        gohome() {
            this.$router.replace("/");
        }
        ,
        tiaotiao() {
            this.$router.replace("/yonghu");
        },
        getone() {
            this.$router.replace("/moni");
        },
        gettwo() {
            this.$router.replace("/zhuanjia");
        },
        getthree() {
            this.$router.replace("/zhuanye");
        },
        // info: function () {
        //     axios({
        //         method: "GET",
        //         url: this.$Fcee_url.url+"/userInfo",

        //     }).then(response => {
        //         this.UserInfo = response.data.rows;
        //         // console.log(response)
        //         // console.log("结果为" + this.UserInfo);
        //         // console.log(this.UserInfo[0])
        //         this.UserName = this.UserInfo[1]
        //         this.UserInfo_url = "http://localhost:8989" + this.UserInfo[0]
        //         // console.log("处理后" + this.UserInfo_url)

        //     })
        // },
        start1: function () {
            this.loading=true
            var Category = this.form.Category;
            var Professional = this.form.Professional;
            var professionaltitle=this.form.professionaltitle;
            axios({
                method: "GET",
                url: "/specialized/getSpecializedName",
                params: {
                    pageNum: this.pageNum,
                    Category: Category,
                    Professional: Professional,
                    professionaltitle:professionaltitle,
                },
            }).then(response => {
                this.tableData = response.data.rows;
                // console.log(response.data.rows.schoolCode)
                this.total = response.data.total;
                this.loading=false
                // console.log(this.tableData.schoolCode);
            })
        },
        info: function () {
      axios({
        method: "GET",
        url: "/userInfo",

      }).then(response => {
        this.UserInfo = response.data.data;
        // console.log(response)
        // console.log("结果为" + this.UserInfo);
        // console.log(this.UserInfo.username);
        this.UserName = this.UserInfo.username;
        this.UserInfo_url = this.$Fcee_url.url + this.UserInfo.Avatar;
        // console.log("处理后" + this.UserInfo_url)

      })
    },
        onSubmit() {
            this.start1();

            // console.log(this.from.SchoolName)
        },
    },
    created() {
        // this.info();
        this.start1();
        // tool.$getLogin()

    }
}
</script>
<style scoped>
    .el-container{
        background-color: #ffff;
    }
body{
    background-color: #ffff;
}

@media screen and (max-width:600px) {
.el-table {margin-top: 200px;
height: 70%;}

    
}
.zhuanye {
    width: 100%;
    height: 100%;
    /* padding-left: 5%;
    padding-right: 5%; */
    background-color: #ffffff;
    margin: 0 auto;
}

.el-main {
    /* width: 100%; */
    background-color: white;
    color: #333;
    /* text-align: center; */
    line-height: 70px;
    padding: 0;
    margin-bottom: 30px;
    overflow: hidden
}

.el-input {
    width: 200px;
    margin-left: 5px;
    margin-top: 50px;
}

.maintop {
    
    height: 150px;

}

.queryschool {
    margin: 30px auto;
    width: auto;
    height: 90%;
}
.abc{
    font-size: 30px;
}
.mingcheng1{
  font-size: 20px;
  font-weight: bolder;
  color: aqua;
}
.mingcheng2{
  font-size: 20px;
  color: rgb(128, 128, 128);
  font-weight: bolder;
}
</style>